home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / telecomm / misc / pbill32.lha / Phonebill / Install Phonebill < prev    next >
Encoding:
Text File  |  1994-12-24  |  9.3 KB  |  329 lines

  1. ;**
  2. ;**  $VER: Install-Phonebill 3.2 (10.12.94)
  3. ;**  Copyright © 1994 SPHINX
  4. ;**
  5.  
  6. (if (< (/ (getversion) 65536) 37)
  7.         (abort wrongkickstart)
  8. )
  9.  
  10.  
  11.  
  12. ;**
  13. ;**  Ask user where to place `phonebill' and setup dir/file vars accordingly
  14. ;**
  15.  
  16. (complete 0)
  17.  
  18. (set pbilldest
  19.     (askdir
  20.         (prompt "Select where to install `phonebill'\nA directory "Phonebill" will be created automatically")
  21.         (help @askdir-help)
  22.         (default @default-dest)
  23.     )
  24. )
  25. (set pbilldir             (tackon pbilldest "Phonebill"))
  26. (set @default-dest        pbilldir)
  27. (set docdir               (tackon pbilldir "Documentation"))
  28. (set configdir            (tackon pbilldir "Config"))
  29. (set ratesfile            (tackon configdir "Rates.config"))
  30. (set catalogdir           (tackon pbilldir "Catalogs"))
  31. (set oldvernum 0)
  32.  
  33.  
  34. ;**
  35. ;**  Create directory/Check if there is already a copy installed
  36. ;**
  37.  
  38. (complete 10)
  39.  
  40. (set extype (exists pbilldir))
  41. (if (= extype 1) (abort "There already exists a file named \"phonebill\""))
  42. (if (= extype 2)
  43.     (
  44.         (if (exists (tackon pbilldir "phonebill"))
  45.             (
  46.                 (set oldvernum (getversion (tackon pbilldir "Phonebill")))
  47.                 (message
  48.                     (cat "A copy of `phonebill' already exists. "
  49.                          "If you proceed, this copy will be updated. Certain files "
  50.                          "will be overwritten."
  51.                     )
  52.                 )
  53.             )
  54.         )
  55.     )
  56.     (makedir pbilldir (infos))
  57. )
  58. (makedir docdir (infos))
  59. (makedir configdir (infos))
  60. (makedir catalogdir)
  61.  
  62. (set oldver (/ oldvernum 65536))
  63. (set oldrev (- oldvernum (* oldver 65536) ) )
  64.  
  65.  
  66.  
  67. ;**
  68. ;**  Install executable and library
  69. ;**
  70.  
  71. (complete 20)
  72.  
  73. (copylib
  74.     (help @copylib-help)
  75.     (prompt "Installing gtlayout.library\nCopyright © 1990-1994 Olaf Barthel")
  76.     (confirm)
  77.     (source "Libs/gtlayout.library")
  78.     (dest "LIBS:")
  79. )
  80.  
  81. (complete 30)
  82.  
  83. (copyfiles
  84.     (help @copyfiles-help)
  85.     (source "Phonebill")
  86.     (dest pbilldir)
  87.     (prompt "Installing the executable program")
  88.     (confirm)
  89.     (infos)
  90. )
  91.  
  92.  
  93. ;**
  94. ;**  Install documentation
  95. ;**
  96.  
  97. (complete 40)
  98.  
  99. (set docchoice
  100.     (askoptions
  101.         (prompt "There are three formats available for the documentation.")
  102.         (choices "AmigaGuide Format (required for online help)" 
  103.                  "TeX DVI Format (for printed manuals)"
  104.                  "Plain ASCII Format")
  105.         (help @askoptions-help)
  106.     )
  107. )
  108. (if (<> 0 (BITAND docchoice 1))
  109.     (
  110.         (copyfiles
  111.             (prompt "Installing AmigaGuide manual...")
  112.             (source "Documentation/Phonebill.guide")
  113.             (dest docdir)
  114.             (help @copyfiles-help)
  115.             (infos)
  116.         )
  117.     )
  118. )
  119.  
  120. (complete 50)
  121.  
  122. (if (<> 0 (BITAND docchoice 2))
  123.     (
  124.         (copyfiles
  125.                 (prompt "Installing DVI manual...")
  126.                 (source "Documentation/Phonebill.DVI")
  127.                 (dest docdir)
  128.                 (help @copyfiles-help)
  129.                 (infos)
  130.         )
  131.     )
  132. )
  133.  
  134. (complete 60)
  135.  
  136. (if (<> 0 (BITAND docchoice 4))
  137.     (
  138.         (copyfiles
  139.                 (prompt "Installing ASCII manual...")
  140.                 (source "Documentation/Phonebill.doc")
  141.                 (dest docdir)
  142.                 (help @copyfiles-help)
  143.                 (infos)
  144.         )
  145.     )
  146. )
  147.  
  148. (complete 65)
  149. (copyfiles
  150.         (prompt "Installing registration forms...")
  151.         (source "Documentation")
  152.         (dest docdir)
  153.         (pattern "Register#?")
  154.         (infos)
  155.         (help @copyfiles-help)
  156. )
  157. (complete 70)
  158.  
  159.  
  160. ;**
  161. ;**  Configuration files
  162. ;**
  163.  
  164. (complete 80)
  165.  
  166. (set installedcfg 0)
  167.  
  168. (if (exists "envarc:phonebill/phonebill.prefs")
  169.     (
  170.         (if (= 1    (askbool(prompt (cat "Old (pre 3.0) `phonebill' configuration files have been found in \"ENV:\" and \"ENVARC:\". "
  171.                                          "Starting from release 3.0, the configuration files "
  172.                                          "have changed from IFF format to plain ASCII text files. "
  173.                                          "Do you want to update these configuration files for use "
  174.                                          "with this release, or do you want to use "
  175.                                          "the default configuration files ?"
  176.                                     )
  177.                              )
  178.                             (help @askbool-help)
  179.                             (choices "Update configuration" "Default configuration")
  180.                     )
  181.             )
  182.  
  183.             (
  184.                 (working "Updating configuration")
  185.                 (run "Extras/UpdateConfig2.x")
  186.                 (copyfiles
  187.                     (help @copyfiles-help)
  188.                     (prompt "Installing the updated configuration files")
  189.                     (source "T:")
  190.                     (dest configdir)
  191.                     (pattern "#?.config")
  192.                     (confirm)
  193.                 )
  194.                 (set installedcfg 1)
  195.             )
  196.         )
  197.         (if (= 1 (askbool (prompt "The files in \"ENV:\" and \"ENVARC:\" are no longer needed. Do you want to remove them?")
  198.                           (help @askbool-help)
  199.                  )
  200.             )
  201.             (
  202.                 (working "Removing `phonebill' related files from \"ENV:\" and \"ENVARC:\"")
  203.                 (run "delete env:phonebill all")
  204.                 (run "delete envarc:phonebill all")
  205.             )
  206.         )
  207.     )
  208. )
  209.  
  210. (complete 90)
  211.  
  212. (if (= installedcfg 0)
  213.     (if (and (= oldver 3) (= oldrev 0))
  214.         (
  215.             (message "The configuration needs to be updated for use with this release of `phonebill'.")
  216.             (working "Updating configuration")
  217.             (run ("Extras/UpdateConfig3.0 \"%s\"" configdir))
  218.             (copyfiles
  219.                 (help @copyfiles-help)
  220.                 (prompt "Installing the updated configuration files")
  221.                 (source "T:")
  222.                 (dest configdir)
  223.                 (pattern "#?.config")
  224.                 (confirm)
  225.             )
  226.         )
  227.         (
  228.             (if (= 0 (exists (tackon configdir "Host.config")))
  229.                 (copyfiles (source "Config/Host.config") (dest configdir))
  230.             )
  231.             (if (= 0 (exists (tackon configdir "Misc.config")))
  232.                 (copyfiles (source "Config/Misc.config") (dest configdir))
  233.             )
  234.             (if (= 0 (exists (tackon configdir "Logs.config")))
  235.                 (copyfiles (source "Config/Logs.config") (dest configdir))
  236.             )
  237.             (if (= 0 (exists (tackon configdir "Presets.config")))
  238.                 (copyfiles (source "Config/Presets.config") (dest configdir))
  239.             )
  240.  
  241.             (set updaterates 1)
  242.  
  243.             (if (= 1 (exists ratesfile))
  244.                 (set updaterates
  245.                     (askbool
  246.                         (prompt "A \"Rates.config\" file already exists. If you didn't modify "
  247.                                 "these rates yourself, you might want to update the rates "
  248.                                 "with the one supplied with this version."
  249.                         )
  250.                         (choices "Install new rates" "Do not modify rates")
  251.                         (help @askbool-help)
  252.                     )
  253.                 )
  254.             )
  255.  
  256.             (if (= 1 updaterates)
  257.                 (
  258.                     (set ratechoice
  259.                         (askoptions
  260.                             (prompt "Select the countries whose rates you wish to install:")
  261.                             (choices "Belgium"
  262.                                      "Deutschland"
  263.                                      "France"
  264.                                      "Italy"
  265.                                      "Nederland"
  266.                                      "Norge"
  267.                                      "Sverige"
  268.                             )
  269.                             (help @askoptions-help)
  270.                         )
  271.                     )
  272.                     (run ("echo \"\" >\"%s\"" ratesfile))
  273.                     (if (<> 0 (BITAND ratechoice 1))
  274.                         (run ("type %s >>\"%s\"" "Config/Rates.config.belgium" ratesfile))
  275.                     )
  276.                     (if (<> 0 (BITAND ratechoice 2))
  277.                         (run ("type %s >>\"%s\"" "Config/Rates.config.deutschland" ratesfile))
  278.                     )
  279.                     (if (<> 0 (BITAND ratechoice 4))
  280.                         (run ("type %s >>\"%s\"" "Config/Rates.config.france" ratesfile))
  281.                     )
  282.                     (if (<> 0 (BITAND ratechoice 8))
  283.                         (run ("type %s >>\"%s\"" "Config/Rates.config.italy" ratesfile))
  284.                     )
  285.                     (if (<> 0 (BITAND ratechoice 16))
  286.                         (run ("type %s >>\"%s\"" "Config/Rates.config.nederland" ratesfile))
  287.                     )
  288.                     (if (<> 0 (BITAND ratechoice 32))
  289.                         (run ("type %s >>\"%s\"" "Config/Rates.config.norge" ratesfile))
  290.                     )
  291.                     (if (<> 0 (BITAND ratechoice 64))
  292.                         (run ("type %s >>\"%s\"" "Config/Rates.config.sverige" ratesfile))
  293.                     )
  294.                 )
  295.             )
  296.         )
  297.     )
  298. )
  299.  
  300. (copyfiles
  301.     (help @copyfiles-help)
  302.     (source "Config/Scanner.config")
  303.     (dest configdir)
  304.     (prompt "Installing scanners (\"Scanner.config\")")
  305.     (confirm)
  306. )
  307.  
  308.  
  309.  
  310. ;**
  311. ;**  Catalog files
  312. ;**
  313.  
  314. (complete 95)
  315.  
  316. (copyfiles
  317.     (help @copyfiles-help)
  318.     (prompt "Installing catalog files")
  319.     (source "Catalogs")
  320.     (dest catalogdir)
  321.     (all)
  322.     (confirm)
  323. )
  324.  
  325. (complete 100)
  326.  
  327. (exit)
  328.  
  329.